<?php
namespace pgc;
use \hc\tpl;
use \hc\session;
use \hc\js;
class Config extends tpl{
	private $cache;
	public function __construct(){
		parent::__construct();
		session::init();
		if(!isset($_SESSION['pgcinfo'])){
			$url=MODEL_URL."/Login/index.html";
			 echo 	js::to_url($url);exit;
		}
	}
	public function index(){
		$this->display('config/index.tpl');
	}
  public function environment(){
		$data=array();
		$data['sysos']=PHP_OS;//操作系统
		$data['sysosico']=$_SERVER["SERVER_SOFTWARE"]; //运行环境
		$data['sysversion']=PHP_VERSION;//获取PHP服务器版本
		$data['sysname']=$_SERVER['SERVER_NAME'];//主机名
		$data['prot']=$_SERVER['SERVER_PORT'];//端口
		$data['document_root']=$_SERVER["DOCUMENT_ROOT"];//网站文档目录
		$data['http_user_agent']=substr($_SERVER['HTTP_USER_AGENT'], 0, 40);//浏览器信息
		$data['upload_max_filesize']=ini_get('upload_max_filesize');//上传附件限制
		$data['max_execution_time']=ini_get('max_execution_time');//执行时间限制
		$data['time']=date("Y年n月j日 H:i:s");//服务器时间
		$data['server_name']=$_SERVER['SERVER_NAME'].'/'.gethostbyname($_SERVER['SERVER_NAME']);//服务器域名/IP
		$data['get_client_ip']=$_SERVER['REMOTE_ADDR'];//用户的IP地址
		$data['space']=round((disk_free_space(".")/(1024*1024)),2).'M';//剩余空间
		//mysql
		$mysqlversion=M()->mysqlinfo();
		$data['mysqlversion']=$mysqlversion['mysqlversion'];
		$this->assign('list',$data);
		$this->display('config/environment.tpl');
	}

}
?>
